# -*- codeing =utf-8 -*-
# @Time : 2022/9/15 上午6:28
# @Author :WXJ
# @File : 3.7.py
# @Software: PyCharm
chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
nums = '1234567890'
isbool = True
while isbool:
    pwd = input("请输入要检查的密码")
    length = len(pwd)
    #isspace()是否都为空格
    while(pwd.isspace() or length==0):
        pwd = input("密码不能为空，请重新输入")
    # 判断长度 0低，1中，2高
    flag_len = 0
    if(length<=8):
        flag_len =0
    elif(8<length<16):
        flag_len=1
    else:
        flag_len=2
    #判断是否包含字母
    flag_chars=0
    for each in pwd:
        if each in chars:
            flag_chars +=1
            break
    #判断是否包含数字
    flag_num =0
    for each in pwd:
        if each in nums:
            flag_num+=1
            break
    if (pwd.isdigit() or pwd.isalpha()):
        flag_num=5
        flag_chars=5

    print("您的密码安全等级为：")
    if flag_len==0 or (flag_num==5 and flag_chars==5):
        print("密码等级为低")
    else:
     {(flag_len==2 and flag_num==1 and flag_chars==1):
        print("密码等级为高")}